public class Test {
    public static void main(String[] args) {
        BinarySearchTree binarySearchTree=new BinarySearchTree();
        int[] a={2,4,1,6,4,7,2,9};
        for (int i = 0; i < a.length; i++) {
            binarySearchTree.insert(a[i]);
        }
        binarySearchTree.remove(2);
    System.out.println(binarySearchTree.search(1));

    }
}
